home *** CD-ROM | disk | FTP | other *** search
- on printBitmap theCast
- if the castType of cast theCast <> #bitmap then
- alert("PrintBitmap can only print bitmapped castmembers.")
- exit
- end if
- if the machineType = 256 then
- set XObjFile to "pmatic.dll"
- set printingFont to "arial"
- else
- set XObjFile to "pmatic.xobj"
- set printingFont to "geneva"
- end if
- openXLib(XObjFile)
- set printer to PrintOMatic(mnew)
- if not objectp(printer) then
- alert("There is no currently selected printer. Printing features are disabled.")
- else
- printer(mRegister, "PMAT130-915-01021")
- printer(mSetMargins, 72, 72, 72, 100)
- set pw to printer(mGetPageWidth)
- set ph to printer(mGetPageHeight)
- set w to the width of cast theCast
- set h to the height of cast theCast
- set scaling to min(float(pw) / float(w), float(ph) / float(h))
- if (scaling < 1.0) and (w > h) then
- printer(mSetLandscapeMode, 1)
- set pw to printer(mGetPageWidth)
- set ph to printer(mGetPageHeight)
- set scaling to min(float(pw) / float(w), float(ph) / float(h))
- end if
- set scaling to min(scaling, 1.0)
- set w to integer(w * scaling)
- set h to integer(h * scaling)
- set left to (pw - w) / 2
- set top to (ph - h) / 2
- printer(mSetPageNumSymbol, "√û")
- printer(mSetTextFont, printingFont)
- printer(mSetTextSize, 10)
- printer(mSetTextStyle, "normal,italic")
- printer(mSetTextJust, "left")
- printer(mDrawText, "Copyright Sky Media/Discovery House Publishers, 1996", 0, ph + 40)
- printer(mSetTextJust, "center")
- printer(mDrawText, "page √û", (pw / 2) + 80, ph + 40)
- printer(mSetTextJust, "right")
- printer(mDrawText, "printed" && the date, pw, ph + 40)
- printer(mLine, 0, ph + 20, pw, ph + 20)
- printer(mSetProgressMsg, "Now Printing Discovery Interactive Document")
- printer(mNewPage)
- printer(mPicture, the picture of cast theCast, left, top, left + w, top + h)
- if printer(mDoJobSetup) = 1 then
- updateStage()
- printer(mPrint)
- end if
- printer(mdispose)
- end if
- closeXLib(XObjFile)
- end
-
- on min a, b
- if a < b then
- return a
- else
- return b
- end if
- end
-